package top.infopub.mgr.fia.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import top.infopub.enums.fia.IncomeSettlementModeEnum;
import top.infopub.enums.fia.PayBillTypeEnum;

import java.math.BigDecimal;
import java.util.Date;

public class PayBillDomain {

    /** SGUID */
    private String id;

    /** 项目编码 */
    private String proCode;

    /** 付款归属项目 */
    private String proName;

    /** 支付类型，1=保证金，2=融资还款，3=融资付息，4=融资付费，5=投标补贴，6=营销奖励 */
    private String payType;

    /** 创建时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date addTime;

    /** 应付金额 */
    private BigDecimal willPayAmount;

    /** 实付金额 */
    private BigDecimal actPayAmount;

    /** 结算方式1=现金，2=支票，3=网银，4=银行承兑汇票，5=商业承兑汇票，6=银行汇票，7=总部代付工程款，8=其他*/
    private String settlementMode;

    /** 状态，0=待确认，1=确认收款 */
    private String status;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProCode() {
        return proCode;
    }

    public void setProCode(String proCode) {
        this.proCode = proCode;
    }

    public String getProName() {
        return proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
        if (StringUtils.isNotBlank(payType)) {
            PayBillTypeEnum ppdt = PayBillTypeEnum.getByCode(payType);
            if (ppdt != null) {
                setPayType(ppdt.getName());
            }
        }
    }

    public BigDecimal getWillPayAmount() {
        return willPayAmount;
    }

    public void setWillPayAmount(BigDecimal willPayAmount) {
        this.willPayAmount = willPayAmount;
    }

    public BigDecimal getActPayAmount() {
        return actPayAmount;
    }

    public void setActPayAmount(BigDecimal actPayAmount) {
        this.actPayAmount = actPayAmount;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }


    public String getSettlementMode() {
        return settlementMode;
    }

    public void setSettlementMode(String settlementMode) {
        this.settlementMode = settlementMode;
        if (StringUtils.isNotBlank(settlementMode)) {
            IncomeSettlementModeEnum ppdt = IncomeSettlementModeEnum.getByCode(settlementMode);
            if (ppdt != null) {
                setSettlementMode(ppdt.getName());
            }
        }
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
